<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

    <input type="file" @change="handleFileSelect(e)" id="filecontrol">


    <script>
        let filecontrol = document.getElementById('filecontrol');
        filecontrol.addEventListener('change', function(e){
            handleFileSelect(e);
        });

        function handleFileSelect(e){
            console.log(e);
            let file = e.target.files[0];
            console.log(file);
            let reader = new FileReader();
            reader.onload = function(e){
                console.log(e);
                let img = document.createElement('img');
                img.src = e.target.result;
                document.body.appendChild(img);
            }
            reader.readAsDataURL(file);
        }





    </script>
    
</body>
</html>